<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Buy</title>
</head>
<body>
	<%
		ArrayList books = (ArrayList)session.getAttribute("books");
		if (books == null) {
			books = new ArrayList();
			session.setAttribute("books", books);
		}
		// session.removeAttribute("books");
		String book = request.getParameter("book");
		// out.println(book);
		if (book != null) {
			books.add(book);
		}
		String delbook = request.getParameter("delbook");
		// out.println(delbook);
		if (delbook != null) {
			books.remove(delbook);
		}
		out.println("购物车中的内容是：" + "<br>");
		for (int i = 0; i < books.size(); i++) {
			out.println(books.get(i) + "<br>");
		}
	%>
</body>
</html>